/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.yutel.biz;

import com.yutel.util.Applation;
import com.yutel.util.ServletProcess;
import java.io.IOException;

/**
 *
 * @author Administrator
 */
public class Charge {
 public static Applation app;

    public Charge() {
        app = Applation.getInstance();
    }

    public String query(String cardno,String cardpwd) {
        try {
            StringBuffer para = new StringBuffer();
            para.append("username=").append(app.getUsername());
            para.append("password=").append(app.getPassword());
            para.append("cardno=").append(cardno);
            para.append("cardpwd=").append(cardpwd);
            String results = ServletProcess.request(para.toString());
            return results;
        } catch (IOException ex) {
            ex.printStackTrace();
            return null;
        }
    }
    public String confirm(String cardno,String cardpwd) {
        try {
            StringBuffer para = new StringBuffer();
            para.append("username=").append(app.getUsername());
            para.append("password=").append(app.getPassword());
            para.append("cardno=").append(cardno);
            para.append("cardpwd=").append(cardpwd);
            // TODO:
            String results = ServletProcess.request(para.toString());
            return results;
        } catch (IOException ex) {
            ex.printStackTrace();
            return null;
        }
    }
}
